import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JFrame;


public class Panel extends JFrame{
	
	public BufferedImage image1;
	
	public Panel()
	{
		super();
		try 
		{
			image1 = ImageIO.read(new File("AoEII.jpg"));
		}
		catch (IOException e) 
		{
			e.printStackTrace();
		}
		
		this.setSize(1024, 720);
		this.getContentPane().setBackground(Color.blue);
	}
	
	@Override
	public void paint(Graphics g)
	{
		Graphics2D g2d = (Graphics2D)g;
		super.paint(g2d);
		g2d.setColor(Color.RED);
		g2d.fillRect(100, 100, 100, 100);
		g2d.drawImage(image1,100,200,null);
	}
	
	public static void main(String[] args) 
	{
		Panel x = new Panel();
		x.setVisible(true);
	}
}